#include <iostream>
#include <fstream>
#include <vector>
#include <string>

#include "point.h"
#include "triangulator.h"

using namespace std;

int main()
{
    size_t n;
    cin >> n;
    vector<point> v(n);
    for (size_t i = 0; i < n; i++)
        cin >> v[i].x >> v[i].y;
/*    vector<triangle> tr = triangulator().delaunay_triangulation(v);
    cout << tr.size() << "\n";
    for (auto t : tr)
        cout << v[t.p[0]] << " " << v[t.p[1]] << " " << v[t.p[2]] << "\n";
*/
    auto d = triangulator().build_diagram(v);
    cout << d.size() << "\n";
    for (auto p : d)
        cout << p.first << " " << p.second << "\n";
    return 0;
}
